# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1312904626.222645
_template_filename=u'/home/pylonsapp/readthematrix/trunk/portal/portal/templates/index.mako'
_template_uri=u'/index.mako'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['title']


def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        self = context.get('self', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n')
        # SOURCE LINE 2

        from portal.lib.auth import check_if_user_is_already_connected
        from pylons import request, response, session, tmpl_context as c, url
        def print_name():
            if check_if_user_is_already_connected():
                    return session['name']
            return ''
        
        
        __M_locals_builtin_stored = __M_locals_builtin()
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['c','print_name','check_if_user_is_already_connected','url','request','session','response'] if __M_key in __M_locals_builtin_stored]))
        # SOURCE LINE 9
        __M_writer(u'    \n<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n    <head>\n        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n        <title>Readthematrix: ')
        # SOURCE LINE 14
        __M_writer(escape(self.title()))
        __M_writer(u'</title>\n        <link rel="stylesheet" type="text/css" href="/design.css" media="screen" />\n        <script type="text/javascript" src="/jQuery/jQuery-1.6.2.min.js"></script>\n        <script type="text/javascript" src="/jQuery/jquery-ui-1.8.14.custom.min.js"></script>\n        <script type="text/javascript" src="/js/functions.js"></script>\n')
        # SOURCE LINE 19
        if check_if_user_is_already_connected():
            # SOURCE LINE 20
            __M_writer(u'\t        <script type="text/javascript">\n\t\t\t\tvar us_id = \'')
            # SOURCE LINE 21
            __M_writer(escape(session['user']))
            __M_writer(u"';\n\t\t        var username = '")
            # SOURCE LINE 22
            __M_writer(escape(session['last_name']))
            __M_writer(u"';\n\t        </script>\n")
            pass
        # SOURCE LINE 25
        __M_writer(u'    </head>\n    <body>\n    <div id="index-header">\n    \t<span id="index-heade-name">Welcome ')
        # SOURCE LINE 28
        __M_writer(print_name() )
        __M_writer(u'</span>\n    \t\n     \t<span id="header-auth-link">\n')
        # SOURCE LINE 31
        if check_if_user_is_already_connected():
            # SOURCE LINE 32
            __M_writer(u'\t\t    \t<a href="/chat">Chat</a>-<a href="/start">Home</a>-<a href="/auth/logout">Logout</a>\n\t\t    \t\n')
            # SOURCE LINE 34
        else:
            # SOURCE LINE 35
            __M_writer(u'\t\t    \t<a href="/auth/login">Login</a>\n')
            pass
        # SOURCE LINE 37
        __M_writer(u'\t\t    \t\n    \t</span>\n    </div>\n\t\t\n<!-- *** BEGIN page content *** -->\n')
        # SOURCE LINE 42
        __M_writer(escape(self.body()))
        __M_writer(u'\n<!-- *** END page content *** -->\n\n    </body>\n</html>')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_title(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        return ''
    finally:
        context.caller_stack._pop_frame()


